<?php 

	require '../utils/conn.php';
	$query = "SELECT message FROM t_message WHERE type=0";
	$result = mysql_query($query);
	$row = mysql_fetch_array($result, MYSQL_ASSOC);
	$allMessage = $row['message'];
	
	$query = "SELECT message FROM t_message WHERE type=1";
	$result = mysql_query($query);
	$row = mysql_fetch_array($result, MYSQL_ASSOC);
	$iBTMessage = $row['message'];
	
	$query = "SELECT message FROM t_message WHERE type=2";
	$result = mysql_query($query);
	$row = mysql_fetch_array($result, MYSQL_ASSOC);
	$GMATMessage = $row['message'];
	
	$query = "SELECT message FROM t_message WHERE type=3";
	$result = mysql_query($query);
	$row = mysql_fetch_array($result, MYSQL_ASSOC);
	$GREMessage = $row['message'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>设置Android推送通知</title>
<script src="../js/pushNotification.js"></script>
</head>
<a href="javascript:history.back(-1)">返回</a><hr/>
<table border='2' rules='rows' align="center" cellpadding='8%'>
	<thead>
		<tr align="center">
			<th>
			<h1>设置Android机经通知</h1>
			</th>
		</tr>
	</thead>
	<tr>
		<td style='background-color: gray; height:30px;'></td>
	</tr>
	<tr align="left">
		<td><input type="text" size="140" id="allMessage" value="<?php echo $allMessage;?>"></input></td>
	</tr>
	<tr align="left">
		<td><input type="button" value="设置推送给所有人" onclick="savePushMessage(0);"></td>
	</tr>
	
	<tr>
		<td style='background-color: gray; height:30px;'></td>
	</tr>
	<tr align="left">
		<td><input type="text" size="140" id="ibtMessage" value="<?php echo $iBTMessage;?>"></input></td>
	</tr>
	<tr align="left">
		<td><input type="button" value="设置推送给iBT同学" onclick="savePushMessage(1);"></td>
	</tr>
	<tr>
		<td style='background-color: gray; height:30px;'></td>
	</tr>
	<tr align="left">
		<td><input type="text" size="140" id="gmatMessage" value="<?php echo $GMATMessage;?>"></input></td>
	</tr>
	<tr align="left">
		<td><input type="button" value="设置推送给gMAT同学" onclick="savePushMessage(2);"></td>
	</tr>
	<tr>
		<td style='background-color: gray; height:30px;'></td>
	</tr>
	<tr align="left">
		<td><input type="text" size="140" id="greMessage" value="<?php echo $GREMessage;?>"></input></td>
	</tr>
	<tr align="left">
		<td><input type="button" value="设置推送给GRE同学" onclick="savePushMessage(3);"></td>
	</tr>
</table>
</body>
</html>